package com.qf.utils;

import org.mindrot.jbcrypt.BCrypt;

public class PasswordEncoding {

    /**
     * 对密码加密
     * @param pw
     * @return
     */
    public static String hashPw(String pw){
        return BCrypt.hashpw(pw,BCrypt.gensalt());
    }

    // 密码的对比
    public static boolean checkpw(String pw,String dbpw){
        return BCrypt.checkpw(pw,dbpw);
    }
}
